package main

import "my_im/server"

func main() {
	srv := server.New("localhost", 8888)
	addUser(srv, "zc", "123", []string{"zz"})
	addUser(srv, "zz", "123", []string{"zc"})
	srv.Start()
}

func addUser(srv *server.Server, name, pass string, friends []string) {
	m := make(map[string]struct{})
	for _, f := range friends {
		m[f] = struct{}{}
	}
	srv.UserInfoMap[name] = &server.UserInfo{
		Name:    name,
		Passwd:  pass,
		Friends: m,
		Groups:  make(map[string]struct{}),
	}
}
